import React, { PureComponent } from 'react'
import { StyleSheet, View } from 'react-native'

export default class SplitLine extends PureComponent {

    static defaultProps = {
        lineHeight: StyleSheet.hairlineWidth,
        color: '#bdbdbd',
        contentStyle: {}
    };

    render() {
        const {
            lineHeight,
            color,
            style,
            contentStyle
        } = this.props;

        return (
            <View style={{ backgroundColor: '#f6f6f6', ...contentStyle }}>
                <View style={[{
                    height: 0,
                    borderTopWidth: lineHeight,
                    borderColor: color,
                    margin: StyleSheet.hairlineWidth
                }, style]}/>
            </View>
        )
    }
}
